import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../author_logic.dart';
import '../../../shared/shared.dart';

class UserAgreement extends StatelessWidget {
  final AuthorLogic controller;

  const UserAgreement({Key? key, required this.controller}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Obx(
          () => InkWell(
            highlightColor: Colors.transparent,
            radius: 0,
            // ignore: avoid_print
            onTap: () => controller.changeSelect(),
            child: Container(
              margin: const EdgeInsets.symmetric(horizontal: 5),
              width: 24,
              height: 24,
              decoration: BoxDecoration(
                  color: controller.state.select.value
                      ? ColorConstants.selectColor
                      : Colors.transparent,
                  shape: BoxShape.circle,
                  border: Border.all(color: ColorConstants.themeColor, width: 2)),
            ),
          ),
        ),
        const Text('点击确定，即表示您已同意用户须知', style: TextStyle(color: ColorConstants.themeColor))
      ],
    );
  }
}
